package org.guajava.service.impl;

import org.springframework.stereotype.Service;
import org.guajava.domain.DictData;
import org.guajava.domain.DictType;
import org.guajava.mapper.DictDataMapper;
import org.guajava.mapper.DictTypeMapper;
import org.guajava.service.IDictTypeService;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * IDictTypeServiceImpl.java
 *
 * @Description:
 * @author: lishiming
 * @Date: 13:15 2019/1/11
 */
@Service
public class IDictTypeServiceImpl implements IDictTypeService {

    @Resource
    private DictTypeMapper dictTypeMapper;
    @Resource
    private DictDataMapper dictDataMapper;

    @Override
    public List<DictType> selectDictTypeList(DictType dictType) {
        return dictTypeMapper.selectDictTypeList(dictType);
    }

    @Override
    public int insertDictType(DictType dictType) {
        return dictTypeMapper.insertSelective(dictType);
    }

    @Override
    public int updateDictType(DictType dictType) {
        return dictTypeMapper.updateByPrimaryKeySelective(dictType);
    }

    @Override
    public int deleteDictTypeByIds(String[] ids) {
        return dictTypeMapper.deleteDictTypeByIds(ids);
    }

    @Override
    public List<DictData> selectDictDataList(Map<String, String> dictData) {
        return dictDataMapper.selectDictDataList(dictData);
    }

    @Override
    public int insertDictData(DictData dictData) {
        return dictDataMapper.insertSelective(dictData);
    }

    @Override
    public int updateDictData(DictData dictData) {
        return dictDataMapper.updateByPrimaryKeySelective(dictData);
    }

    @Override
    public int deleteDictDataByIds(String[] ids) {
        return dictDataMapper.deleteByIds(ids);
    }
}
